//
// Created by lfm on 2025/3/3.
//
#include <iostream>
using namespace std;
//函数调用运算符重载

//打印输出类
class MyPrint
{
public:
    void operator() (string text)
    {
        cout << text << endl;
    }
};
//相加类
class MyAdd
{
public:
    int operator() (int a, int b)
    {
        return a + b;
    }
};
void test01()
{
    MyPrint p;
    p("hello GUET");
}
void test02()
{
    MyAdd add;
    cout << add(100, 200) << endl;
    //匿名函数对象
    cout << MyAdd()(200, 500) << endl;
}
int main()
{
    //test01();
    test02();
    return 0;
}